// *****************************************************************************
// Copyright (c) 2005 - 2017 Qualcomm Technologies International, Ltd.
// %%version
//
// *****************************************************************************

#ifdef DEBUG_ON
   #define DEBUG_AACDEC
   #define ENABLE_PROFILER_MACROS
   #define AACDEC_CALL_ERROR_ON_POSSIBLE_CORRUPTION
   #define AACDEC_CALL_ERROR_ON_MALLOC_FAIL
#endif

#include "profiler.h"


// includes
#include "aac.h"
#include "aac_mem.h"
#include "global_variables.asm"
#include "init_decoder.asm"
#include "reset_decoder.asm"
#include "silence_decoder.asm"
#include "decoder_state.asm"
#include "frame_decode.asm"
#include "adts_read_frame.asm"
#include "mem_alloc.asm"
#include "getbits.asm"
#include "showbits.asm"
#include "byte_align.asm"
#include "raw_data_block.asm"
#include "decode_sce.asm"
#include "decode_cpe.asm"
#include "discard_dse.asm"
#include "program_element_config.asm"
#include "decode_fil.asm"
#include "individual_channel_stream.asm"
#include "ics_info.asm"
#include "calc_sfb_and_wingroup.asm"
#include "section_data.asm"
#include "scalefactor_data.asm"
#include "pulse_data.asm"
#include "pulse_decode.asm"
#include "tns_data.asm"
#include "ltp_data.asm"
#include "spectral_data.asm"
#include "huffman_unpack.asm"
#include "huffman_decode.asm"
#include "reconstruct_channels.asm"
#include "apply_scalefactors_and_dequantize.asm"
#include "reorder_spec.asm"
#include "ms_decode.asm"
#include "pns_decode.asm"
#include "is_decode.asm"
#include "ltp_decode.asm"
#include "ltp_reconstruction.asm"
#include "mdct.asm"
#include "filterbank_analysis_ltp.asm"
#include "tns_encdec.asm"
#include "filterbank.asm"
#include "imdct.asm"
#include "windowing.asm"
#include "overlap_add.asm"
#include "corruption.asm"
#include "init_static_decoder.asm"
#include "init_tables.asm"


// mp4/m4a file support
#include "mp4_read_frame.asm"
#include "mp4_sequence.asm"
#include "mp4_read_atom_header.asm"
#include "mp4_moov_routine.asm"
#include "mp4_discard_atom_data.asm"
#include "mp4_ff_rew.asm"

// latm support
#include "latm_read_frame.asm"
#include "audio_mux_element.asm"
#include "stream_mux_config.asm"
#include "audio_specific_config.asm"
#include "ga_specific_config.asm"
#include "latm_get_value.asm"
#include "payload_length_info.asm"
#include "payload_mux.asm"

// SBR support
#ifdef AACDEC_SBR_ADDITIONS
   #include "sbr_global_variables.asm"
   #include "sbr_extension_data.asm"
   #include "sbr_header.asm"
   #include "sbr_reset.asm"
   #include "sbr_calc_tables.asm"
   #include "sbr_fband_tables.asm"
   #include "sbr_fmaster_table_calc_fscale_gt_zero.asm"
   #include "sbr_fmaster_table_calc_fscale_eq_zero.asm"
   #include "sbr_single_channel_element.asm"
   #include "sbr_channel_pair_element.asm"
   #include "sbr_dtdf.asm"
   #include "sbr_invf.asm"
   #include "sbr_grid.asm"
   #include "sbr_huff_dec.asm"
   #include "sbr_allocate_and_unpack_from_flash.asm"
   #include "sbr_read_one_word_from_flash.asm"
   #include "sbr_envelope.asm"
   #include "sbr_noise.asm"
   #include "sbr_bubble_sort.asm"
   #include "sbr_envelope_time_border_vector.asm"
   #include "sbr_envelope_noise_border_vector.asm"
   #include "sbr_middle_border.asm"
   #include "sbr_extract_envelope_data.asm"
   #include "sbr_extract_noise_floor_data.asm"
   #include "sbr_envelope_noise_dequantisation.asm"
   #include "sbr_envelope_noise_dequantisation_coupling_mode.asm"
   #include "sbr_read_qdiv_tables.asm"
   #include "sbr_fp_mult_frac.asm"
   #include "sbr_hf_generation.asm"
   #include "sbr_calc_chirp_factors.asm"
   #include "sbr_patch_construction.asm"
   #include "sbr_auto_correlation_opt.asm"
   #include "sbr_prediction_coeff.asm"
   #include "sbr_limiter_frequency_table.asm"
   #include "sbr_hf_adjustment.asm"
   #include "sbr_estimate_current_envelope.asm"
   #include "sbr_calculate_gain.asm"
   #include "sbr_calculate_limiter_band_boost_coefficients.asm"
   #include "sbr_get_s_mapped.asm"
   #include "sbr_hf_assembly.asm"
   #include "sbr_hf_assembly_initialise_outer_loop_iteration.asm"
   #include "sbr_hf_assembly_save_persistent_gain_signal_envelopes.asm"
   #include "sbr_hf_assembly_initialise_signal_gain_and_component_loop.asm"
   #include "sbr_hf_assembly_calc_gain_filters_smoothing_mode.asm"
   #include "sbr_analysis_filterbank.asm"
   #include "sbr_analysis_dct_kernel.asm"
   #include "sbr_construct_x_matrix.asm"
   #include "sbr_synthesis_filterbank_combined.asm"
   #include "sbr_synthesis_construct_v.asm"
   #include "sbr_synthesis_downsampled_construct_v.asm"
   #include "sbr_save_prev_data.asm"
   #include "sbr_wrap_last_thfgen_envelopes.asm"
   #include "sbr_swap_channels.asm"
#endif

#ifdef AACDEC_ELD_ADDITIONS
   #include "eld_global_variables.asm"
   #include "eld_specific_config.asm"
   #include "eld_raw_data_block.asm"
   #include "eld_decode_sce.asm"
   #include "eld_decode_cpe.asm"
   #include "eld_individual_channel_stream.asm"
   #include "eld_imdct480.asm"
   #include "eld_sbr_grid.asm"
   #include "eld_sbr_block.asm"
   #include "eld_sbr_data.asm"
   #include "eld_overlap_add.asm"
   #include "eld_windowing.asm"
#endif

#ifdef AACDEC_PS_ADDITIONS
   #include "ps_global_variables.asm"
   #include "ps_data.asm"
   #include "ps_extension.asm"
   #include "ps_huff_dec.asm"
   #include "ps_data_decode.asm"
   #include "ps_hybrid_analysis.asm"
   #include "ps_hybrid_type_a_fir_filter.asm"
   #include "ps_hybrid_type_b_fir_filter.asm"
   #include "ps_hybrid_synthesis.asm"
   #include "ps_delta_decode.asm"
   #include "ps_map_34_parameters_to_20.asm"
   #include "ps_decorrelate.asm"
   #include "ps_stereo_mixing.asm"
   #include "ps_transient_detection.asm"
   #include "ps_initialise_transient_detection_for_hybrid_freq_bins_flash.asm"
   #include "ps_initialise_transient_detection_for_qmf_freq_bins_flash.asm"
   #include "ps_initialise_decorrelation_for_hybrid_freq_bins_flash.asm"
   #include "ps_initialise_decorrelation_for_qmf_freq_bins_flash.asm"
   #include "ps_initialise_stereo_mixing_for_hybrid_freq_bins_flash.asm"
   #include "ps_initialise_stereo_mixing_for_qmf_freq_bins_flash.asm"
#endif

#ifdef BUILD_WITH_C_SUPPORT
   #include "aac_library_c_stubs.asm"
#endif
